/**
 * @note 关闭气泡
 * @author 吴义迪
 * @create_time 2016-11-24
 */
function closePopup(){
	if(Global.common.popup){
	    try{
	    	Global.common.popup.hide();
	    	Global.common.popup.destroy();
	    }
	    catch(e){}
	}
}

/**
 * @note 打开监测报警气泡
 * @author 吴义迪
 * @create_time 2017-06-29
 */
function openJCBJPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
    var date = new Date(f.info.observTimes.time == null ? f.info.observTimes : f.info.observTimes.time);
    var observTimes = timeFormat1(date);
    var color = "";
	var monitorFlag = false;
	var title = "";
	for(var n=0; n<Global.monitor.jcbj.length; n++){
		if(Global.monitor.jcbj[n].flag == f.info.grouping){
			title = Global.monitor.jcbj[n].name;
		}
	}
    for(var i=0; i<Global.monitor.info.length; i++){
    	if(f.info.grouping == Global.monitor.info[i].flag){
    		var html1 = "";
    		var infoArr = Global.monitor.info[i].info2.split(",");
    		var infoUnitArr = Global.monitor.info[i].info2Unit.split(",");
    		var valueArr = f.info.warnValue1.split(",");
    		for(var k=0; k<infoArr.length; k++){
    			html1 += "	<tr class=\"popup_tr\">" +
						"		<td class=\"popup_style1\">"+infoArr[k]+"：</td>" +
						"		<td class=\"popup_style2\">"+valueArr[k]+" "+infoUnitArr[k]+"</td>" +
						"	</tr>";
    		}
    		Global.monitor.info[i].info2.split(",");
    		html = "<p class=\"popup_p\" style=\"font-weight:bold; color:"+color+"\">"+(title + f.info.warnType + "实况报警")+"</p>" +
			"<hr class=\"popup_hr\"/>" +
			"<table class=\"popup_table\">" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">站名：</td>" +
			"		<td class=\"popup_style2\">"+f.info.stationName+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">站号：</td>" +
			"		<td class=\"popup_style2\">"+f.info.stationId+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">经度：</td>" +
			"		<td class=\"popup_style2\">"+f.info.lon+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">纬度：</td>" +
			"		<td class=\"popup_style2\">"+f.info.lat+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">监测时间：</td>" +
			"		<td class=\"popup_style2\">"+observTimes+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">"+Global.monitor.info[i].info1+"：</td>" +
			"		<td class=\"popup_style2\">"+f.info.warnValue+" "+f.info.unit+"</td>" +
			"	</tr>" + html1 +
			"</table>";
			monitorFlag = true;
			break;
    	}
    }
    if(monitorFlag == false){
    	html = "<p class=\"popup_p\" style=\"font-weight:bold; color:"+color+"\">"+(title + f.info.warnType + "实况报警")+"</p>" +
		"<hr class=\"popup_hr\"/>" +
		"<table class=\"popup_table\">" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">站名：</td>" +
		"		<td class=\"popup_style2\">"+f.info.stationName+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">站号：</td>" +
		"		<td class=\"popup_style2\">"+f.info.stationId+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">经度：</td>" +
		"		<td class=\"popup_style2\">"+f.info.lon+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">纬度：</td>" +
		"		<td class=\"popup_style2\">"+f.info.lat+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">监测时间：</td>" +
		"		<td class=\"popup_style2\">"+observTimes+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">监测结果：</td>" +
		"		<td class=\"popup_style2\">"+f.info.warnValue+" "+f.info.unit+"</td>" +
		"	</tr>" +
		"</table>";
    }
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开预警信号气泡
 * @author 吴义迪
 * @create_time 2017-07-14
 */
function openYJXHPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
    html = "<p class=\"popup_p\" style=\"font-weight:bold;\">"+f.info.title+"</p>" +
			"<hr class=\"popup_hr\"/>" +
			"<div>" +
			"	<div class=\"popup_div\">"+f.info.content+"</div>" +
			"	<div class=\"popup_div\" style=\"text-align:right;\">" +
			"		<a onclick=\"openYJXHResultInfo('"+f.info.alertId+"','"+f.info.eventtype+"','"+f.info.level+"','"+f.info.msgtype+"')\" style=\"text-decoration:underline;\">发布情况</a>" +
			"	</div>" +
			"</div>";
	popup = new SuperMap.Popup.FramedCloud(
	null,										//弹窗的唯一标识，如设为null，则将会自动生成
	new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
	null,										//弹窗内容的大小
	html,										//弹窗中显示的一个HTML要素的字符串
	icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
	true,										//在弹出窗口的里面是否显示关闭窗
	null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开涉农主体气泡
 * @author 陈靖宇
 * @create_time 2017-07-23
 */
function openSSZTPopup(f){
	closePopup();
	var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "<div style=`width: 3000px; height: 3000px;`><div>";
	var popup;
	// $.ajax({
	// 	url: "",
	// 	type: "post",
	// 	data: {},
	// 	dataType: "json",
	// 	success:function(result){
	// 		if(result.length > 0){
				html += "<div id=`userName` style=`float: left`>黄河</div>" +
						"<div id=`userCode`>潼南县-太安镇(500223)</div>" +
						"<div id=`userType`>种植大户</div>" +
						"<div id=`companyUrl`><a href=`http://www.baidu.com/` target=`_blank`>www.baidu.com</a></div>" +
						"<hr class=`popup_hr`/></div>" +
								"<div style=`height: 100%; margin-top: 0;`>" +
								"<ul class=`popul`>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>经营范围: 蔬菜种植</li>" +
							 	"<li class=`popli`>面积/生产规模: 1990.7</li>" + 
								"</div><div class=`uldiv`>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>年产值(万): 600</li>" +
								"<li class=`popli`>从事生产人数: 6</li>" + //result.TechCount !== null ? result.TechCount : ""
								"</div>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>技术人员: 3</li>" +
								"<li class=`popli`>技术人员平均年龄: 48</li>" +
								"</div>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>电脑联网: 是</li>"+
								"<li class=`popli`>智能手机: 有</li>"+
								"</div>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>智能手机品牌: 三星S8</li>"+
								"<li class=`popli`>负责人: 蔡少锋</li>"+
								"</div>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>负责人电话: 13912345678</li>"+
								"<li class=`popli`>技术主管: 蔡少锋</li>"+
								"</div>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>技术主管电话: 13912345678</li>"+
								"<li class=`popli`>地址: </li>"+
								"</div>" +
								"<div class=`uldiv`>" +
								"<li class=`popli`>介绍: </li>"+
								"</div>" +
								"</ul>";
	// 		}
	// 	},
	// 	error:function(){
	// 		//异常处理
	// 		window.console.log("请求涉世主体数据异常");
	// 	}
	// });
	html += "</div></div>";
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		new SuperMap.Size(2000, 2000),  			//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
		);
		f.popup = popup;
		Global.common.popup = popup;
		Global.common.map.addPopup(popup);
}


/**
 * @note 打开雷电气泡
 * @author 吴义迪
 * @create_time 2017-06-29
 */
function openLightningPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
    var dateTime = new Date();
	var year = parseInt(f.info["Datetime"].substring(0,4));
	var month = parseInt(f.info["Datetime"].substring(5,7))-1;
	var date = parseInt(f.info["Datetime"].substring(8,10));
	var hour = parseInt(f.info["Datetime"].substring(11,13));
	var min = parseInt(f.info["Datetime"].substring(14,16));
	var sec = parseInt(f.info["Datetime"].substring(17,19));
	dateTime.setFullYear(year, month, date);
	dateTime.setHours(hour, min, sec);
	dateTime.setHours(dateTime.getHours()+8);
	var dateStr = timeFormat1(dateTime);
	html = "<p class=\"popup_p\" style=\"font-weight:bold;\">雷电定位数据</p>" +
			"<hr class=\"popup_hr\"/>" +
			"<table class=\"popup_table\">" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">电流强度：</td>" +
			"		<td class=\"popup_style2\">"+f.info["Lit_Current"]+"（10KA）</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">回击最大陡度：</td>" +
			"		<td class=\"popup_style2\">"+f.info["MARS_3"]+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">定位误差：</td>" +
			"		<td class=\"popup_style2\">"+f.info["Pois_Err"]+" km</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">经度：</td>" +
			"		<td class=\"popup_style2\">"+f.info["Lon"]+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">纬度：</td>" +
			"		<td class=\"popup_style2\">"+f.info["Lat"]+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">雷电地理位置：</td>" +
			"		<td class=\"popup_style2\">"+(f.info["Lit_City"] == "" ? "-" : (f.info["Lit_City"] + " - " + f.info["Lit_Cnty"]))+"</td>" +
			"	</tr>" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">资料时间：</td>" +
			"		<td class=\"popup_style2\">"+dateStr+"</td>" +
			"	</tr>" +
			"</table>";
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开旅游景点气泡
 * @author 吴义迪
 * @create_time 2017-08-01
 */
function openScenicPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
    html = "<p class=\"popup_p\" style=\"font-weight:bold;\">"+Config[f.info.layerId].popupTitle+"&nbsp;&nbsp;"+f.info.jqType+"</p>" +
		   "<hr class=\"popup_hr\"/>" +
		   "<table class=\"popup_table\">";
    if(f.info.jqName != null && f.info.jqName != ""){
    	html += "<tr class=\"popup_tr\">" +
				"	<td class=\"popup_style1\">景区名称：</td>" +
				"	<td style=\"padding:2px 0 0 0;\"><div style=\"max-width:300px; padding:0;\">"+f.info.jqName+"</div></td>" +
				"</tr>";
    }
    if(f.info.cityName != null && f.info.cityName != ""){
    	html += "<tr class=\"popup_tr\">" +
				"	<td class=\"popup_style1\">景区地址：</td>" +
				"	<td style=\"padding:2px 0 0 0;\"><div style=\"max-width:300px; padding:0;\">"+f.info.cityName+""+((f.info.countryName == null || f.info.countryName == "") ? "" : ("-" + f.info.countryName))+"</div></td>" +
				"</tr>";
    }
	if(f.info.jqCaPtion != null && f.info.jqCaPtion != ""){
		html += "<tr class=\"popup_tr\">" +
				"	<td class=\"popup_style1\">景区介绍：</td>" +
				"	<td style=\"padding:2px 0 0 0;\"><div style=\"max-width:300px; padding:0;\">"+f.info.jqCaPtion+"</div></td>" +
				"</tr>";
	}
    html += "</table>";
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开全景气泡
 * @author 吴义迪
 * @create_time 2017-08-05
 */
function openPanoramaPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
    html = "<p class=\"popup_p\" style=\"font-weight:bold;\">"+Config[f.info.layerId].popupTitle+"</p>" +
		   "<hr class=\"popup_hr\"/>" +
		   "<table class=\"popup_table\">";
    if(f.info.name != null && f.info.name != ""){
    	html += "<tr class=\"popup_tr\">" +
				"	<td class=\"popup_style1\">名称：</td>" +
				"	<td style=\"padding:2px 0 0 0;\">"+f.info.name+"</td>" +
				"</tr>";
    }
	if(f.info.lon != null && f.info.lon != ""){
		html += "<tr class=\"popup_tr\">" +
				"	<td class=\"popup_style1\">经度：</td>" +
				"	<td style=\"padding:2px 0 0 0;\">"+f.info.lon+"</td>" +
				"</tr>";
	}
	if(f.info.lat != null && f.info.lat != ""){
    	html += "<tr class=\"popup_tr\">" +
				"	<td class=\"popup_style1\">纬度：</td>" +
				"	<td style=\"padding:2px 0 0 0;\">"+f.info.lat+"</td>" +
				"</tr>";
    }
    html += "</table>";
    html += "<div class=\"popup_div\" style=\"color:#4187e7;\">单击展示全景效果</div>";
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开气泡
 * @author 陈靖宇
 * @create_time 2017-07-16
 */
function openNPointLayerPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
    var imgHtml = "";
    // if(Config[58].popupImg){
    // 	imgHtml = "<img src=\""+Config[58].popupImg.url+"\" style=\"width:"+Config[58].popupImg.width+";height:"+Config[58].popupImg.height+";position:relative;bottom:"+Config[58].popupImg.bottom+";margin-left:5px;\"/>";
    // }
	html += "<p class=\"popup_p\" style=\"font-weight:bold;\">"+f.info.username+"</p>" +
			"<p class=\"popup_p\" style=\"font-size: 10px;\">"+f.info.time+"</p>" +
			"<hr class=\"popup_hr\"/>";													
	html +=	"<table class=\"popup_table\">";	
	for(var i=0; i<Config[58].featurnInfo.length; i++){
		if(f.info[Config[58].featurnInfo[i].flag] != null && f.info[Config[58].featurnInfo[i].flag] != ""){
			html += "<tr class=\"popup_tr\">" +
				    // "		<td class=\"popup_style1\">"+Config[58].featurnInfo[i].name+"：</td>" +
					"		<td style=\"font-size: 14px;\" class=\"popup_style2\">"+f.info[Config[58].featurnInfo[i].flag] + "</td>" +
					"</tr>";							 
		}
	}
	html +=	"</table>" +
			"<div id=\"imgdiv\">";
	if( f.info.imgurl != null && f.info.imgurl != "" && f.info.imgurl != "no pic"){
		for(i=0;i<f.info.imgurl.length;i++){
			if(  i % 3 == 0  && i !== 0){
				html += "</br>";
			}else{
				url = "http://39.107.24.230:8020/ChinaAPP/" +f.info.imgurl[i];
				html += "<img onclick=\"openImageWin('"+ url +"')\" src=\""+url+"\" style=\"width: 120px; height:120px; position:relative; bottom: 0;margin-left: 5px; cursor: pointer;\"/>";
			}			
		}
	}else{ 
			html += "<p class=\"popup_p\" style=\"font-weight:bold;\">暂无图片</p>" + 
					"<table class=\"popup_table\">";
	}					
	html += "</div>";	
	popup = new SuperMap.Popup.FramedCloud(
		null,											//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), 	//地图上弹窗显示的位置
		null,											//弹窗内容的大小
		html,											//弹窗中显示的一个HTML要素的字符串
		icon,											//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,											//在弹出窗口的里面是否显示关闭窗
		null											//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开基础点图气泡
 * @author 吴义迪
 * @create_time 2017-07-02
 */
function openBasePointLayerPopup(f){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
	var imgHtml = "";
	if(Config[f.info.layerId].popupImg){
			imgHtml = "<img src=\""+Config[f.info.layerId].popupImg.url+"\" style=\"width:"+Config[f.info.layerId].popupImg.width+";height:"+Config[f.info.layerId].popupImg.height+";position:relative;bottom:"+Config[f.info.layerId].popupImg.bottom+";margin-left:5px;\"/>";
	}
	html += "<p class=\"popup_p\" style=\"font-weight:bold;\">"+Config[f.info.layerId].popupTitle+""+imgHtml+"</p>" +
			"<hr class=\"popup_hr\"/>" +
			"<table class=\"popup_table\">";
	for(var i=0; i<Config[f.info.layerId].featurnInfo.length; i++){
		if(f.info[Config[f.info.layerId].featurnInfo[i].flag] != null && f.info[Config[f.info.layerId].featurnInfo[i].flag] != ""){
			if( Config.station.indexOf(f.info.layerId) >= 0 ){
				if(Config[f.info.layerId].featurnInfo[i].name == "站点ID"){
					Global.stationid = f.info[Config[f.info.layerId].featurnInfo[i].flag];
				}
				else if(Config[f.info.layerId].featurnInfo[i].name== "站点名"){
					Global.stationname = f.info[Config[f.info.layerId].featurnInfo[i].flag];
				}
		   }
			
			html += "	<tr class=\"popup_tr\">" +
					"		<td class=\"popup_style1\">"+Config[f.info.layerId].featurnInfo[i].name+"：</td>" +
					"		<td class=\"popup_style2\">"+f.info[Config[f.info.layerId].featurnInfo[i].flag]+""+(Config[f.info.layerId].featurnInfo[i].unit == null ? "" : (" " + Config[f.info.layerId].featurnInfo[i].unit))+"</td>" +
					"	</tr>";
		}
	}
	if( Config.station.indexOf(f.info.layerId) >= 0 ){
		 html += "<td class=\"popup_style2\" style=\"cursor: pointer; color: #FF0000;\" onclick=\"openWindow();\">气象数据</td>"
	}
			
	html += "</table>";
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开聚散气泡
 * @author 吴义迪
 * @create_time 2017-07-04
 */
function openClusterPopup(f, param){
	closePopup();
    var center = f.geometry.getBounds().getCenterLonLat();
    var icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-18, -3));
    var html = "";
    var popup;
	html += "<p class=\"popup_p\" style=\"font-weight:bold;\">"+param.title+"</p>" +
			"<hr class=\"popup_hr\"/>" +
			"<table class=\"popup_table\">" +
			"	<tr class=\"popup_tr\">" +
			"		<td class=\"popup_style1\">聚散数量：</td>" +
			"		<td class=\"popup_style2\">"+param.count+"</td>" +
			"	</tr>";
			"</table>";
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	f.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开自动站实况数据气泡
 * @author 吴义迪
 * @create_time 2017-08-09
 */
function openMicaps3Popup(feature, returnColumnArr, id){
	closePopup();
	var columnObj={};
	for(var i=0;i<returnColumnArr.length;i++){
		columnObj["column"+i]=returnColumnArr[i];
	}
	var geo = feature.geometry;
    var bounds = geo.getBounds();
    var center = bounds.getCenterLonLat();
    var html = "";
    var icon;
    var popup;
    var station=feature.info;
    var dataHtml = "";
    if(columnObj["column4"] == "WEP_Now" || columnObj["column4"] == "WEP_Past_1" || columnObj["column4"] == "WEP_Past_2"){
		for(var k=0; k<Global.weather.length; k++){
			if(Global.weather[k].flag == station[columnObj["column4"]]){
				station[columnObj["column4"]] = Global.weather[k].name;
				break;
			}
		}
	}
    if(returnColumnArr.length > 5){
    	for(var i=5; i<returnColumnArr.length; i++){
    		var columnName = "";
    		for(var j=0; j<infoReplaceArray.length; j++){
    			if(columnObj["column"+i] == infoReplaceArray[j].flag){
    				columnName = infoReplaceArray[j].name;
    				break;
    			}
    		}
    		dataHtml += "	<tr class=\"popup_tr\">" +
			    		"		<td class=\"popup_style1\">"+columnName+"：</td>" +
			    		"		<td class=\"popup_style2\">"+station[columnObj["column"+i]]+"</td>" +
			    		"	</tr>";
    	}
    }
    html = "<p class=\"popup_p\">"+station[columnObj["column1"]]+" "+station[columnObj["column0"]]+"</p>" +
		"<hr class=\"popup_hr\"/>" +
		"<table class=\"popup_table\">" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">站名：</td>" +
		"		<td class=\"popup_style2\">"+station[columnObj["column0"]]+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">站号：</td>" +
		"		<td class=\"popup_style2\">"+station[columnObj["column1"]]+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">经度：</td>" +
		"		<td class=\"popup_style2\">"+station[columnObj["column2"]]+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">纬度：</td>" +
		"		<td class=\"popup_style2\">"+station[columnObj["column3"]]+"</td>" +
		"	</tr>" +
		"	<tr class=\"popup_tr\">" +
		"		<td class=\"popup_style1\">"+$("#advancedQuery_type_div"+$("#advancedQuery_time_"+id+">span[flag='1']").attr("index")+"_"+id+">span[flag='1']").html()+"：</td>" +
		"		<td class=\"popup_style2\">"+(station[columnObj["column4"]] == "缺测" ? "缺测" : station[columnObj["column4"]] + " " +station.unit)+"</td>" +
		"	</tr>" +
		dataHtml +
		"</table>";
	icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-15, -10));
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	feature.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}

/**
 * @note 打开地面填图气泡
 * @author 吴义迪
 * @create_time 2017-08-09
 */
function openMicaps1Popup(feature, returnColumnArr, id){
	closePopup();
	var columnObj={};
	for(var i=0;i<returnColumnArr.length;i++){
		columnObj["column"+i]=returnColumnArr[i];
	}
	var layerType10FlagArray = [];
	$("#advancedQuery_type_"+id+">span[flag='1']").each(function(){
		if($(this).attr("value") != "" && $(this).attr("value") != undefined){
			var value = $(this).attr("value").split(";");
			for(var i=0; i<value.length; i++){
				var value1 = value[i].split(",");
				layerType10FlagArray.push(value1[0]);
			}
		}
	});
	var geo = feature.geometry;
    var bounds = geo.getBounds();
    var center = bounds.getCenterLonLat();
    var html = "";
    var icon;
    var popup;
    var station=feature.info;
    html = "<p class=\"popup_p\">"+station[columnObj["column1"]]+" "+station[columnObj["column0"]]+"</p>" +
		"<hr class=\"popup_hr\"/>" +
		"<table class=\"popup_table\">";
    for(var i=0; i<layerType10FlagArray.length; i++){
    	var flag = false;
		if(station[layerType10FlagArray[i]] == "" || (!isNaN(station[layerType10FlagArray[i]]) && parseInt(station[layerType10FlagArray[i]]) > 900000)){
			flag = true;
		}
    	if(layerType10FlagArray[i] == "TEM_ChANGE_24h"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">24小时变温：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  ℃"))+"</td>" +
		    		"	</tr>";
    	}else if(layerType10FlagArray[i] == "PRS_Change_24h"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">24小时变压：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  百帕"))+"</td>" +
		    		"	</tr>";
    	}else if(layerType10FlagArray[i] == "TEM"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">温度：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  ℃"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "PRS_Sea"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">海平面气压：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  百帕"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "WEP_Now"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">现在天气：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]]))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "CLO_Cov"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">总云量：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  %"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "WIN_S_Avg_2mi"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">2分钟平均风速：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  m/s"))+"</td>" +
		    		"	</tr>" +
		    		"	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">2分钟平均风向：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station["WIN_D_Avg_2mi"] + " （缺测）") : (station["WIN_D_Avg_2mi"] + "  度"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "PRS_Change_3h"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">3小时变压：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  百帕"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "VIS"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">水平能见度（人工）：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  m"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "WEP_Past_1"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">过去天气1：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]]))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "WEP_Past_2"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">过去天气2：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]]))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "DPT"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">露点温度：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  ℃"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "CLO_Height_LoM"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">低云高：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  m"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "CLO_Cov_Low"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">低云量：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + "  %"))+"</td>" +
		    		"	</tr>";
		}else if(layerType10FlagArray[i] == "PRE_6h"){
    		html += "	<tr class=\"popup_tr\">" +
		    		"		<td class=\"popup_style1\">6小时降水：</td>" +
		    		"		<td class=\"popup_style2\">"+(flag == true ? (station[layerType10FlagArray[i]] + " （缺测）") : (station[layerType10FlagArray[i]] + " mm"))+"</td>" +
		    		"	</tr>";
		}
    }
	html += "</table>";
	icon = new SuperMap.Icon(null, null, new SuperMap.Pixel(-15, -10));
	popup = new SuperMap.Popup.FramedCloud(
		null,										//弹窗的唯一标识，如设为null，则将会自动生成
		new SuperMap.LonLat(center.lon,center.lat), //地图上弹窗显示的位置
		null,										//弹窗内容的大小
		html,										//弹窗中显示的一个HTML要素的字符串
		icon,										//锚点，包含一个大小信息 SuperMap.Size和偏移信息 SuperMap.Size的对象。(一般为 SuperMap.Icon类型）
		true,										//在弹出窗口的里面是否显示关闭窗
		null										//关闭弹窗触发该回调函数
	);
	feature.popup = popup;
	Global.common.popup = popup;
	Global.common.map.addPopup(popup);
}